<?php

namespace app\controller\admin\cnf;

use app\bll\Frame as BllFrame;
use core\controller\AdminBase;
use Exception;

/**
 * 框架本身的控制器
 */
class Frame extends AdminBase
{

    public function index()
    {
        $bllFrame = new BllFrame();
        $bllFrame->checkUpgrade();
        return $this->view();
    }

    /**
     * 升级版本
     *
     * @return mixed
     */
    public function upgrade()
    {
        try {
            $bllFrame = new BllFrame();
            $bllFrame->onlineUpgrade();
        } catch (Exception $ex) {
            return $this->error($ex->getMessage());
        }
        return $this->success();
    }
}
